package com.yjj.springboot3.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 文件上传配置类
 *
 * @author yjj
 */
@Data
@Component
@ConfigurationProperties(prefix = "file")
public class FileConfig {

    /**
     * 文件上传路径
     */
    private String profile = "D:/upload";

    /**
     * 资源映射路径前缀
     */
    private String resourcePrefix = "/profile";

    /**
     * 获取上传路径
     */
    public String getUploadPath() {
        return profile + "/upload";
    }

    /**
     * 获取头像上传路径
     */
    public String getAvatarPath() {
        return profile + "/avatar";
    }

    /**
     * 获取下载路径
     */
    public String getDownloadPath() {
        return profile + "/download";
    }
}
